package com.elmcode.server.config;

import com.elmcode.server.properties.OSSProperties;
import com.elmcode.server.utils.AliYunOSSUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliyunConfig {

    @Bean
    public AliYunOSSUtil createAliYunOSSUtil(OSSProperties ossProperties){

        AliYunOSSUtil aliYunOSSUtil = new AliYunOSSUtil(ossProperties.getEndpoint(),
                ossProperties.getAccessKey(),ossProperties.getSecretKey(),ossProperties.getBucket());
        return aliYunOSSUtil;
    }


}
